<template>
	<view>
		<u-search placeholder="请输入关键词" v-model="keyword" border-color="#1296db" :focus="true"></u-search>
		<unicloud-db v-slot:default="{data, loading, error, options}" collection="goods-list" :where="where">
			<view v-if="error">{{error.message}}</view>
			<view v-else>
				<u-row gutter="16">
					<u-col span="6" v-for="(good,index) in data" :key="index">
						<goods-card :good="good"></goods-card>
					</u-col>
				</u-row>
			</view>
		</unicloud-db>
	</view>

</template>

<script>
	export default {
		data() {
			return {
				keyword: '',
				// where:'',
			}
		},
		computed: {
			where() {
				return `${new RegExp(this.keyword, 'i')}.test(shopName)`
			}
		},
		methods: {
			// searchGoods() {
			// 	console.log(11);
			// }
		}
	}
</script>

<style>

</style>
